let nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3
let merge = function(nums1, m, nums2, n){
    for(let i = m; i < m + n; i++){
        nums1[i] = nums2[i - m]
    }

    nums1.sort((a, b) => a - b)
    
    return nums1
}

merge(nums1, m, nums2, n)

console.log(nums1)